package com.ncsc.erp.model;
// Generated 20 มิ.ย. 2557, 12:55:43 by Hibernate Tools 3.4.0.CR1


import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * MmSupplierDiscount generated by hbm2java
 */
@Entity
@Table(name="mm_supplier_discount"
    ,catalog="ncsc_erp"
)
public class MmSupplierDiscount  implements java.io.Serializable {


     private MmSupplierDiscountId id;
     private MmSupplier mmSupplier;
     private BigDecimal supplierDiscountPerc;
     private Date supplierDiscountEffectiveDate;
     private Date supplierDiscountExpireDate;
     private Short supplierDiscountIsActive;

    public MmSupplierDiscount() {
    }

	
    public MmSupplierDiscount(MmSupplierDiscountId id, MmSupplier mmSupplier) {
        this.id = id;
        this.mmSupplier = mmSupplier;
    }
    public MmSupplierDiscount(MmSupplierDiscountId id, MmSupplier mmSupplier, BigDecimal supplierDiscountPerc, Date supplierDiscountEffectiveDate, Date supplierDiscountExpireDate, Short supplierDiscountIsActive) {
       this.id = id;
       this.mmSupplier = mmSupplier;
       this.supplierDiscountPerc = supplierDiscountPerc;
       this.supplierDiscountEffectiveDate = supplierDiscountEffectiveDate;
       this.supplierDiscountExpireDate = supplierDiscountExpireDate;
       this.supplierDiscountIsActive = supplierDiscountIsActive;
    }
   
     @EmbeddedId

    
    @AttributeOverrides( {
        @AttributeOverride(name="supplierNo", column=@Column(name="SUPPLIER_NO", nullable=false) ), 
        @AttributeOverride(name="supplierDiscountSeqNo", column=@Column(name="SUPPLIER_DISCOUNT_SEQ_NO", nullable=false) ) } )
    public MmSupplierDiscountId getId() {
        return this.id;
    }
    
    public void setId(MmSupplierDiscountId id) {
        this.id = id;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="SUPPLIER_NO", nullable=false, insertable=false, updatable=false)
    public MmSupplier getMmSupplier() {
        return this.mmSupplier;
    }
    
    public void setMmSupplier(MmSupplier mmSupplier) {
        this.mmSupplier = mmSupplier;
    }

    
    @Column(name="SUPPLIER_DISCOUNT_PERC", precision=10)
    public BigDecimal getSupplierDiscountPerc() {
        return this.supplierDiscountPerc;
    }
    
    public void setSupplierDiscountPerc(BigDecimal supplierDiscountPerc) {
        this.supplierDiscountPerc = supplierDiscountPerc;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="SUPPLIER_DISCOUNT_EFFECTIVE_DATE", length=10)
    public Date getSupplierDiscountEffectiveDate() {
        return this.supplierDiscountEffectiveDate;
    }
    
    public void setSupplierDiscountEffectiveDate(Date supplierDiscountEffectiveDate) {
        this.supplierDiscountEffectiveDate = supplierDiscountEffectiveDate;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="SUPPLIER_DISCOUNT_EXPIRE_DATE", length=10)
    public Date getSupplierDiscountExpireDate() {
        return this.supplierDiscountExpireDate;
    }
    
    public void setSupplierDiscountExpireDate(Date supplierDiscountExpireDate) {
        this.supplierDiscountExpireDate = supplierDiscountExpireDate;
    }

    
    @Column(name="SUPPLIER_DISCOUNT_IS_ACTIVE")
    public Short getSupplierDiscountIsActive() {
        return this.supplierDiscountIsActive;
    }
    
    public void setSupplierDiscountIsActive(Short supplierDiscountIsActive) {
        this.supplierDiscountIsActive = supplierDiscountIsActive;
    }




}


